Optimal. Leaf size=44 \[ \frac{2 a^2 \tan (c+d x)}{d}+\frac{2 a^2 \sec (c+d x)}{d}-\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.126434, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.259, Rules used = {2873, 3767, 8, 2622, 321, 207, 2606} \[ \frac{2 a^2 \tan (c+d x)}{d}+\frac{2 a^2 \sec (c+d x)}{d}-\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2873
Rule 3767
Rule 8
Rule 2622
Rule 321
Rule 207
Rule 2606
Rubi steps
\begin{align*} \int \csc (c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx &=\int \left (2 a^2 \sec ^2(c+d x)+a^2 \csc (c+d x) \sec ^2(c+d x)+a^2 \sec (c+d x) \tan (c+d x)\right ) \, dx\\ &=a^2 \int \csc (c+d x) \sec ^2(c+d x) \, dx+a^2 \int \sec (c+d x) \tan (c+d x) \, dx+\left (2 a^2\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac{a^2 \operatorname{Subst}(\int 1 \, dx,x,\sec (c+d x))}{d}+\frac{a^2 \operatorname{Subst}\left (\int \frac{x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}-\frac{\left (2 a^2\right ) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=\frac{2 a^2 \sec (c+d x)}{d}+\frac{2 a^2 \tan (c+d x)}{d}+\frac{a^2 \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac{2 a^2 \sec (c+d x)}{d}+\frac{2 a^2 \tan (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.114016, size = 69, normalized size = 1.57 \[ \frac{a^2 \left (\log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )+\frac{4 \sin \left (\frac{1}{2} (c+d x)\right )}{\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )}\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.089, size = 55, normalized size = 1.3 \begin{align*} 2\,{\frac{{a}^{2}}{d\cos \left ( dx+c \right ) }}+2\,{\frac{{a}^{2}\tan \left ( dx+c \right ) }{d}}+{\frac{{a}^{2}\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.08082, size = 88, normalized size = 2. \begin{align*} \frac{a^{2}{\left (\frac{2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 4 \, a^{2} \tan \left (d x + c\right ) + \frac{2 \, a^{2}}{\cos \left (d x + c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.12321, size = 327, normalized size = 7.43 \begin{align*} \frac{4 \, a^{2} \cos \left (d x + c\right ) + 4 \, a^{2} \sin \left (d x + c\right ) + 4 \, a^{2} -{\left (a^{2} \cos \left (d x + c\right ) - a^{2} \sin \left (d x + c\right ) + a^{2}\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) +{\left (a^{2} \cos \left (d x + c\right ) - a^{2} \sin \left (d x + c\right ) + a^{2}\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{2 \,{\left (d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.26659, size = 51, normalized size = 1.16 \begin{align*} \frac{a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - \frac{4 \, a^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]